Get Joystick-Triggered Event
Function:
magicbox.get_joystick_button(port)Description: get the event triggered by joystick
Required parameter:
- port: controller port, data type: int, range: 1~6
Return:
List: gathering of joystick-triggered events, detailed as below:
[ ]:No operation
[0]:magicbox.BTN_UP (joystick up)
- [1]:magicbox.BTN_DOWN (joystick down)
- [2]:magicbox.BTN_LEFT (joystick left)
- [3]:magicbox.BTN_RIGHT (joystick right)
- [4]:magicbox.BTN_MIDDLE (push the joystick down from the middle position)
Example
List = magicbox.get_joystick_button(port=2)Detect the joystick module connected to Port 2 of controller, and get the gathering of joystick-triggered events.